load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "protobuf",
    srcs = [
        "config.go",
        "fix.go",
        "generate.go",
        "kinds.go",
        "lang.go",
        "override.go",
        "resolve.go",
    ],
    importpath = "github.com/stackb/rules_proto/pkg/language/protobuf",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/protoc",
        "@bazel_gazelle//config:go_default_library",
        "@bazel_gazelle//label:go_default_library",
        "@bazel_gazelle//language:go_default_library",
        "@bazel_gazelle//repo:go_default_library",
        "@bazel_gazelle//resolve:go_default_library",
        "@bazel_gazelle//rule:go_default_library",
    ],
)

go_test(
    name = "protobuf_test",
    srcs = [
        "generate_test.go",
        "override_test.go",
    ],
    embed = [":protobuf"],
    deps = [
        "//pkg/protoc",
        "@bazel_gazelle//config:go_default_library",
        "@bazel_gazelle//label:go_default_library",
        "@bazel_gazelle//language:go_default_library",
        "@bazel_gazelle//resolve:go_default_library",
        "@bazel_gazelle//rule:go_default_library",
        "@bazel_gazelle//testtools:go_default_library",
        "@com_github_google_go_cmp//cmp",
    ],
)

filegroup(
    name = "all_files",
    testonly = True,
    srcs = [
        "BUILD.bazel",
    ] + glob(["*.go"]),
    visibility = ["//pkg:__pkg__"],
)
